<%--
  Created by IntelliJ IDEA.
  User: Snakewood
  Date: 2020/12/24
  Time: 16:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>零食展示页面</title>

    <style>
        img{
            width: 6cm;
            height: 6cm;
        }
        a{text-decoration: none;}
        .biankuang:hover{border:3px solid red}
        .biankuang{border: 3px solid white}

    </style>
    <link type="text/css" rel="stylesheet" href="css/totop.css">
    <link type="text/css" rel="stylesheet" href="css/leibiebiankuang.css">
</head>
<body>

<%@include file="totop.jsp"%>
<%@include file="head.jsp"%>
<%@include file="search.jsp"%>
<%@include file="menu.jsp"%>
<div style="text-align: center">
    <table border="1"     cellspacing="0"    bordercolor="#00CCCC" style="margin: auto">
        <tr align="right">
            <td colspan="7">
                <c:if test="${empty user}">
                    <span>
                        <a style="font-size: 12px" href="login.jsp">您尚未登录，请登录！</a>&nbsp;&nbsp;&nbsp;
                        <a style="font-size: 12px" href="regist.jsp">还没有账号？点此注册！</a>
                    </span>
                </c:if>
                <c:if test="${not empty user}">
                    ${user.username},你好！
                </c:if>
            </td>
        </tr>
    </table>

    <table border="2px"     cellspacing="15px"    bordercolor="#00CCCC" style="margin: auto">
        <c:forEach items="${foodList}" var="m" varStatus="s">
            <c:if test="${(s.index+1) % 4 ==1} ">
                <tr>
            </c:if>
                <td class="biankuang" >

                    <img src="${m.pic}"><br>
                        ${m.foodname}<br>
                        ${m.flavor}<br>
                        <a style="font-size: 20px;color: red;">￥${m.price}</a><br>
                    <a href="food?op=scan&fid=${m.fid}">查看</a>

                </td>
            <c:if test="${(s.index+1) % 4==0}">
                </tr>
            </c:if>
        </c:forEach>


    </table>
</div>
</body>
</html>
